#include "basicoperation.h"
#include "common.h"
#include "e_oneround.h"

void e_oneround( word *state , word roundkey1 , word roundkey2 )
{
	word t , u ;
	t = rotate_left( state[1]*(2*state[1]+1) , last_5_bits(lgw) ) ;
	u = rotate_left( state[3]*(2*state[3] + 1) , last_5_bits(lgw) ) ;
	state[0] = rotate_left( state[0]^t , last_5_bits(u) ) +roundkey1 ;
	state[2] = rotate_left( state[2]^u , last_5_bits(t) ) + roundkey2 ;

	word tmp ;
	tmp = state[0] ;
	state[0] = state[1] ;
	state[1] = state[2] ;
	state[2] = state[3] ;
	state[3] = tmp ;
}